common/vm_event: prevent guest locking with large max_vcpus
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Fri, 10 Feb 2017 09:42:02 +0000 (10:42 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Feb 2017 09:42:02 +0000 (10:42 +0100)
commit7f8445d9678a1689f470a2614fae398f9b4e7f68
treed96749d6591bfaa2638050bbc59d38b03abd8f57
parent1f32b0291e98217d6a802e0ee30acb1a4929f84a
common/vm_event: prevent guest locking with large max_vcpus

It is currently possible for the guest to lock when subscribing
to synchronous vm_events if max_vcpus is larger than the
number of available ring buffer slots. This patch no longer
blocks already paused VCPUs, fixing the issue for this use
case, and wakes up as many blocked VCPUs as there are slots
available in the ring buffer, eliminating the blockage for
asynchronous events.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
xen/common/vm_event.c